
#ifndef PARAM_H
#define PARAM_H
	#include "stm32f1xx_hal.h"
	
	__inline void set_PRIMASK1(unsigned int priMask)
	{
		register unsigned int __regPriMask         __asm("primask");
		__regPriMask = (priMask);
	}


	#define CLOSE_IRP1()  set_PRIMASK1(1)
	#define OPEN_IRP1()   set_PRIMASK1(0)
	
	#define PARAM_START_PAGE    63
	#define PARAM_START_ADDRESS (0x08000000 + 0x400*PARAM_START_PAGE)
	#define PARAM_START_CRC     (PARAM_START_ADDRESS+18*32)  /* 0XAA, 0X55 */
			
	uint8_t load_param(uint32_t* src, uint32_t* dest, uint8_t len);
	
	uint8_t save_param(uint32_t* params, uint32_t len);
	
#endif

